home *** CD-ROM | disk | FTP | other *** search
- Path: longwood.cs.ucf.edu!not-for-mail
- From: stevens@longwood.cs.ucf.edu (John Stevens)
- Newsgroups: comp.lang.c++
- Subject: STL, MSVC 4.0 and namespaces, can your code do this?
- Date: 18 Jan 1996 15:49:41 -0500
- Organization: University of Central Florida
- Message-ID: <4dmbp5$pjb@longwood.cs.ucf.edu>
- NNTP-Posting-Host: longwood.cs.ucf.edu
- Summary: Making STL work with MSVC & MFC, not!
- Keywords: STL MFC namespace
- X-Newsreader: TIN [version 1.2 PL2]
-
- All,
-
- I am interested in using the STL containers for a system which must be
- compilable with MFC code under MSVC 4.0. I have followed the instructions
- included by MS in the readme. They led me through setting up a namespace
- (std) for the STL, and touching the STL code to make sure that swap,
- allocate and and deallocate all had std namespace resolution added. I've
- done all this, and now comes the problem. When I compile, the compiler
- gives me the following error:
-
- defalloc.h(124) : error C2660: 'new' : function does not take 2 parameters
-
- on the following line of code (from the STL):
-
- template <class T1, class T2>
- inline void construct(T1* p, const T2& value) {
- new (p) T1(value); // here's the error line!
- }
-
- I think that the namespace has somehow hidden the global new operator (with
- placement syntax) from this call. I tried prepending :: to new, but got the
- same error. :-(
-
- This is a sample which causes the trouble:
-
- namespace std {
- #include <vector.h>
- }
-
- int main() ;
- int main()
- {
- std::vector<double> a ;
-
- a.push_back(1.0) ;
- a.pop_back() ;
- return 0 ;
- }
-
- Help!!!! Have I stepped off the precipice of technology or what?
-
- John S.
-